

//
//  MyShopNormalCell.m
//  BusinessMarket
//
//  Created by Michael Li on 2018/11/1.
//  Copyright © 2018年 Michael Li. All rights reserved.
//

#import "MyShopNormalCell.h"
#import "ShopSubModel.h"
@interface MyShopNormalCell()
@property (weak, nonatomic) IBOutlet UIImageView *iv;
@property (weak, nonatomic) IBOutlet UILabel *titleL;
@property (weak, nonatomic) IBOutlet UILabel *subL;
@property (weak, nonatomic) IBOutlet UILabel *lineL;

@end
@implementation MyShopNormalCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.subL.backgroundColor = kOrangeBg;
    self.subL.textColor = [UIColor whiteColor];
    self.lineL.textColor = kLineColor;
    self.iv.layer.masksToBounds = YES;
    self.iv.layer.cornerRadius = 6;
    self.iv.layer.borderColor  = k187Color.CGColor;
    self.iv.layer.borderWidth  = 1;

}

- (void)setShopModel:(ShopSubModel *)shopModel
{
    _shopModel = shopModel;
    [self.iv sd_setImageWithURL:[NSURL URLWithString:shopModel.logo] placeholderImage:[UIImage imageNamed:@""]];
    self.titleL.text = shopModel.title;
    XLog(@"shopModel.demandCount:%@",shopModel.demandCount);
    XLog(@"associationCount:%ld",shopModel.associationCount);
    /**
     2018-12-20 01:19:03.824511+0800 BusinessMarket[6570:1076060] shopModel.demandCount:-2836336969211436301
     2018-12-20 01:19:03.824729+0800 BusinessMarket[6570:1076060] associationCount:12
     */
    /**
     shopModel.demandCount:-6071557873399104696
     2018-12-18 22:38:46.378533+0800 BusinessMarket[5176:854359] associationCount:0
     */
    if ([shopModel.demandCount integerValue] !=0) {
        if (shopModel.associationCount !=0) {
//            self.subL.hidden = NO;
            self.subL.text = [NSString stringWithFormat:@"%@款需求上新,%ld款服务上新",shopModel.demandCount,shopModel.associationCount];
        }else{
//            self.subL.hidden = YES;
            self.subL.text = [NSString stringWithFormat:@"%@款需求上新",shopModel.demandCount];
        }
    }else {
        if (shopModel.associationCount == 0) {
            self.subL.hidden = YES;
            
        }else{
            self.subL.text = [NSString stringWithFormat:@"%ld款服务上新",shopModel.associationCount];
        }
    }
    
}

@end
